package com.ruoyi.project.kbjz.mapper;

import com.ruoyi.project.kbjz.domain.KbjzRegister;
import com.ruoyi.project.kbjz.domain.vo.KbjzVoCondition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface KbjzRegisterMapper {
    /**
     * 添加挂号单
     * @param kbjzRegister
     * @return
     */
    int addRegister(KbjzRegister kbjzRegister);

    /**
     * 根据条件查询部门id
     * @param kbjzRegister 查询条件
     * @return 返回符合条件的部门编号
     */
    List<Long> selectDeptIdByRegister(KbjzRegister kbjzRegister);

    /**
     * 根据条件查询所有符合条件的患者、医生、科室、挂号信息
     * @param condition 查询条件
     * @return
     */
    List<KbjzRegister> selectRegisterByCondition(KbjzVoCondition condition);

    /**
     * 修改挂号状态
     * @param registerStatus 根据状态值修改
     * @return
     */
    @Update("update kbjz_register set register_status = #{registerStatus} where register_id = #{registerId}")
    int updateRegisterStatus(@Param("registerStatus") int registerStatus,@Param("registerId") String registerId);
    @Update("update kbjz_register set user_id = #{userId} where register_id = #{registerId}")
    int updateRegisterUserId(@Param("userId") Long userId,@Param("registerId") String registerId);
}
